package com.liming.common.enums;

import com.liming.common.pojo.vo.product.MiniProductPageQueryVO;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liming
 * @date 2025/3/24
 */
@Getter
@AllArgsConstructor
public enum MiniProductPageQueryEnum {

    PRICE_RANGE("价格区间", "priceRange",
            List.of("0~500", "500~1000", "1000~3000", "3000~6000", "6000~10000", "10000~30000", "30000~max"));

    private final String queryName;
    private final String queryField;
    private final List<String> queryValue;

    public static List<MiniProductPageQueryVO> pageQuery() {
        List<MiniProductPageQueryVO> list = new ArrayList<>();
        for (MiniProductPageQueryEnum queryEnum : MiniProductPageQueryEnum.values()) {
            MiniProductPageQueryVO miniProductPageQueryVO = new MiniProductPageQueryVO();
            miniProductPageQueryVO.setQueryName(queryEnum.getQueryName());
            miniProductPageQueryVO.setQueryField(queryEnum.getQueryField());
            miniProductPageQueryVO.setQueryValue(queryEnum.getQueryValue());
            list.add(miniProductPageQueryVO);
        }
        return list;
    }
}
